package jersey;

import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import rightsmanagement.RightsAdministrationService;
import superkigav.shared.rightsmanagement.IRightsAdministration;
import superkigav.shared.rightsmanagement.UserGroup;

@Path("/rightsAdministration")
public class RightsAdministrationServer implements IRightsAdministration {

	@POST
	@Path("/addUser")
	@Produces(MediaType.TEXT_HTML)
	@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
	public void addUser(@FormParam("username") String username,
			@FormParam("password") String password,
			@FormParam("group") UserGroup group) {
		RightsAdministrationService.getRightsAdministrationService().addUser(username, password, group);
		return;
	}

}
